package sd.czw.com.miemiegoushop.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import sd.czw.com.miemiegoushop.R;
import sd.czw.com.miemiegoushop.data.GoodsModelk;

/**
 * Created by czw
 * desc 描述：
 * on 2017/10/11.
 */
public class MyPullAdapter extends BaseQuickAdapter<GoodsModelk.ErrmsgBean,BaseViewHolder>{


    public MyPullAdapter(@LayoutRes int layoutResId, @Nullable List<GoodsModelk.ErrmsgBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsModelk.ErrmsgBean item) {
        helper.setText(R.id.tv,item.getGoods_name());
        Glide.with(mContext).load("http://miemiegou.com/"+item.getGoods_img()).asBitmap().into((ImageView) helper.getView(R.id.iv));
    }

    @Override
    public void setNewData(List list) {
        mData = list;
        notifyDataSetChanged();
    }

}
